	<div class="Main_Right" >
		<div class="Main_Right_Top"><span></span></div>
		<div class="Main_Right_Content" id="Main_Right_Content">
			  <div class="Main_Right_Title">当前位置：学校管理 --> 专业管理 --> 新增专业课程  </div>
              <!-- Main_information begin -->
			  <div class="Main_handleBar check_pass" id="Main_handleBar" style="display: none"   >
					<div class="Main_handleBar_head"></div>
					<div class="Main_handleBar_body">
						<p></p>
					</div>
			  </div>
			  <form name="thisForm"  id="thisForm" method="post" action="${base}/majors/addcourse.action" >
				<input type=hidden name=id value=>
				<input type=hidden name=isAdmin value=>
			   <div class="Main_Right_ListTable">
					<div class="Main_Right_SearchTable_Title">
						<span class="Main_Right_SearchTable_Title_Left"></span>
						基本信息
						<span class="Main_Right_SearchTable_Title_Right"></span>
					</div>
					<div class="Main_Right_p"  style="padding-left:10px">
						<table border="0" cellspacing="0" cellpadding="0"  width="100%" class="newTable">
							<tr>
								<td class="content"  width="80%" colspan='5'>
									<input type="hidden" class="addtext" id="objId" name="objId" value="${(major.id)!''}"/>
									专业名称：<span style='font-weight:bold;'>${(major.majorName)!""}</span>
								</td>
								<td class="content"  width="10%" style="text-align:right;">
							        &nbsp;&nbsp;<input id="btnCheckAll" type="button" value="全选" />
						            &nbsp;&nbsp;<input id="btnCheckNone" type="button" value="全不选" />
							        &nbsp;&nbsp;<input id="btnCheckReverse" type="button" value="反选" />
								</td>
							</tr>			
				            <#assign count=0 />   
				            <#if courseList?exists>
					            <#assign mod=courseList.size()%6 />   
					            <#list courseList as obj>
					            	<#if count%6==0>
					            		<tr class="odd" onmouseover="this.className='even'" onmouseout="this.className='odd'">
					            	</#if>
					            	<td class="nui-table-cell" width='16%'>
					            	    <#assign flag = false>
										<#list major.courseList as chosedCourse>
											<#if chosedCourse.id == obj.id>
							            	    <#assign flag = true>
							            	    <#break>
											</#if>
										</#list>
										<#if flag == true>
						            		<input type='checkbox' name='courseIdList' id='course${(obj.id)!""}' value='${(obj.id)!""}' checked/>
						            		<label for="course${(obj.id)!""}">${(obj.chineseName)?if_exists}</label>
										<#else>
						            		<input type='checkbox' name='courseIdList' id='course${(obj.id)!""}' value='${(obj.id)!""}' />
						            		<label for="course${(obj.id)!""}">${(obj.chineseName)?if_exists}</label>
										</#if>
					            	</td>
					            	<#assign count = count + 1 /> 
					            </#list>
					        </#if>	
					        <#list mod..(6-1) as i>	
					        	<td class="nui-table-cell"  width='16%'>&nbsp;</td>
					        </#list>	
						</table>
					</div>
		  			<div class="Main_Right_SearchTable_Bottom2"  style="text-align:center;">
						<div  role="button" tabindex="0" class="js-component-button nui-mainBtn nui-btn ">
							<span class="nui-btn-text" onclick="toSubmit();"  >保存</span>
						</div>
						<div  role="button" tabindex="0" class="js-component-button nui-mainBtn nui-btn ">
							<span class="nui-btn-text" onclick="goBack('${base}/majors/list.action')" >返回</span>
						</div>
		 			 </div>
			    </div>
				</form>
		 </div>
	 </div>
	 <script> 
jQuery(document).ready(function($){
		$("table").find("td").removeClass("title");
		$("table").find("td").removeClass("content1");
		$("table").find("th").addClass("nui-table-cell");
		$("table").find("td").addClass("nui-table-cell2");
		$("table").find("input").attr("size","25");
	 	$( "#businessDate" ).datepicker();
		$( "#businessDate" ).datepicker( "option", "dateFormat",'yy-mm-dd' );	
	 	$( "#sendGoodsTime" ).datepicker();
		$( "#sendGoodsTime" ).datepicker( "option", "dateFormat",'yy-mm-dd' );			
});		
function validate(formData, jqForm, options) { 
     if(Validator.Validate(jqForm[0],3)){
      	return true;
     } 
     return false;
}
function toSubmit(){
		 var form=document.getElementById("thisForm");
	     if(Validator.Validate(form,3)){
            $("#thisForm").ajaxSubmit({  
                    type: 'post',  
                    url: "${base}/majors/addcourse.action" ,  
                    success: function(data){  
                        loadNewContent('${base}/majors/list.action');
                    },  
                    error: function(XmlHttpRequest, textStatus, errorThrown){  
                        alert( "error");  
                    }  
            }); 
		}
} 
function jsSelectItemByValue(objSelect, objItemText) {            
	//判断是否存在        
	var isExit = false;        
	for (var i = 0; i < objSelect.options.length; i++) {        
		if (objSelect.options[i].value == objItemText) {        
			objSelect.options[i].selected = true;        
			isExit = true;        
			break;        
		}        
	}              
} 
</script>

   <script type="text/javascript">
        $(function () {
            // 全选
            $("#btnCheckAll").bind("click", function () {
                $("[name = courseIdList]:checkbox").attr("checked", true);
            });
 
            // 全不选
            $("#btnCheckNone").bind("click", function () {
                $("[name = courseIdList]:checkbox").attr("checked", false);
            });
 
            // 反选
            $("#btnCheckReverse").bind("click", function () {
                $("[name = courseIdList]:checkbox").each(function () {
                    $(this).attr("checked", !$(this).attr("checked"));
                });
            });
 
            // 全不选
            $("#btnSubmit").bind("click", function () {
                var result = new Array();
                $("[name = courseIdList]:checkbox").each(function () {
                    if ($(this).is(":checked")) {
                        result.push($(this).attr("value"));
                    }
                });
 
                alert(result.join(","));
            });
        });
    </script>